estpost corr Msourcing_metric_sb  Msourcing_metric_sbe Mduration_m_sb Mnum_m_sb if n_sb==1 & sb_in_sample==1 & Msourcing_metric_sb!=0, matrix listwise
*esttab using "${tables}\TableC5PanelB1.tex", unstack not noobs compress

preserve 
keep Msourcing_metric_sb  Msourcing_metric_sbe Mduration_m_sb Mnum_m_sb b_id s_id
duplicates drop 
drop if Msourcing_metric_sb==.
bys b_id: gen t=_n
bys b_id: gen N=_N
egen s_fe=group(s_id)

xtset b_id t 
qui: xtreg Msourcing_metric_sb , i(b_id) fe 
display in smcl as text "ICC = " as result e(rho)
gen ICC_1 = e(rho)
xtset b_id t 
xtreg Msourcing_metric_sbe  , i(b_id) fe 
display in smcl as text "ICC = " as result e(rho)
gen ICC_2 = e(rho)
xtset b_id t 
xtreg Mnum_m_sb  , i(b_id) fe 
display in smcl as text "ICC = " as result e(rho)
gen ICC_3 = e(rho)

eststo O_TC5_B2: estpost tabstat ICC_1 ICC_2 ICC_3, statistics(mean) columns(statistics)	
*esttab O_TC5_B2 using "${tables}\TableC5PanelB2.tex", cells("mean(fmt(a2))")  nomtitles label nonumbers noobs unstack replace posthead(" ") nodep collabels(none) prehead(" ") postfoot(" ")

restore